package cn.i7baozh;

import cn.i7baozh.condition.ChineseImportCondition;
import cn.i7baozh.condition.EnglishImportCondition;
import cn.i7baozh.service.HelloService;
import cn.i7baozh.service.HiService;
import cn.i7baozh.service.impl.ChineseHelloService;
import cn.i7baozh.service.impl.CustomHiService;
import cn.i7baozh.service.impl.EnglishHelloService;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Conditional;

/**
 * @author zhangbaoqi532
 * @date 2025/1/13
 */
public class TestAutoConfiguration {

    @Conditional(EnglishImportCondition.class)
    @Bean
    public HelloService englishHelloService(){
        return new EnglishHelloService();
    }

    @Conditional(ChineseImportCondition.class)
    @Bean
    public HelloService cineseHelloService(){
        return new ChineseHelloService();
    }

}
